import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose'
import mongoose from 'mongoose'

@Schema()
export class Role {
  @Prop()
  name: string

  @Prop([{ type: mongoose.Schema.Types.ObjectId, ref: 'Rule' }])
  rules: string[]

  @Prop()
  desc: string

  @Prop()
  type: string

  @Prop()
  state: boolean

  _id: mongoose.Schema.Types.ObjectId
  // private _ruleList: any
}

export const RoleSchema = SchemaFactory.createForClass(Role)
